/* 
 * File:   algebra.h
 * Author: gustavo
 *
 * Created on August 12, 2011, 3:50 AM
 */

#ifndef ALGEBRA_H
#define	ALGEBRA_H

#include "matrix.h"

class Algebra {
public:

    template <class T>
    static Matrix<T> add(Matrix<T>& A, Matrix<T>& B) {
        
        //Matrix<T> * C = 0x0;
        Matrix<T> C(A.getRows(), A.getColumns());
        T * adt;
        T * bdt;
        T * cdt;
        
        C.c = 'T';

        adt = A.getData();
        bdt = B.getData();
        cdt = C.getData();

        long int i;
        for (i = 0; i < A.getSize(); i++) {
            cdt[i] = adt[i] + bdt[i];
        }

        return C;
    }

    template <class T>
    static Matrix<T> mult(Matrix<T>& A, Matrix<T>& B) {
        Matrix<T> C(A.getRows(), B.getColumns());
        T * cdata;

        cdata = C.getData();

        return C;
    }



};




#endif	/* ALGEBRA_H */

